//
//  UIButton+YYAdd.h
//  YYKit
//
//  Created by championfu on 2024/11/26.
//  Copyright © 2024 ibireme. All rights reserved.
//

#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN

typedef NS_ENUM(NSInteger, YYButtonContentLayoutStyle) {
    YYButtonContentLayoutStyleNormal = 0,       // 内容居中-图左文右
    YYButtonContentLayoutStyleCenterImageRight, // 内容居中-图右文左
    YYButtonContentLayoutStyleCenterImageTop,   // 内容居中-图上文下
    YYButtonContentLayoutStyleCenterImageBottom,// 内容居中-图下文上
    YYButtonContentLayoutStyleLeftImageLeft,    // 内容居左-图左文右
    YYButtonContentLayoutStyleLeftImageRight,   // 内容居左-图右文左
    YYButtonContentLayoutStyleRightImageLeft,   // 内容居右-图左文右
    YYButtonContentLayoutStyleRightImageRight,  // 内容居右-图右文左
};
IB_DESIGNABLE
@interface UIButton (YYAdd)

/// Graphic style
@property (nonatomic, assign) IBInspectable NSInteger layoutType;
/// Picture and text spacing, the default is 0px
@property (nonatomic, assign) IBInspectable CGFloat padding;
/// The spacing between the graphic and text borders, the default is 5px
@property (nonatomic, assign) IBInspectable CGFloat margin;

/// Set graphics and text mixing, the default border spacing between graphics and text is 5px
/// @param layoutStyle Graphic and text mixed style
/// @param padding Image and text spacing
- (void)contentLayout:(YYButtonContentLayoutStyle)layoutStyle
                 padding:(CGFloat)padding;

/// Set image and text mixing
/// FIXME: There is a problem with this writing that it will break the automatic layout of the button
/// @param layoutStyle Graphic and text mixed style
/// @param padding Image and text spacing
/// @param periphery The distance between the graphic borders
- (void)contentLayout:(YYButtonContentLayoutStyle)layoutStyle
                 padding:(CGFloat)padding
               margin:(CGFloat)margin;

@end


NS_ASSUME_NONNULL_END
